<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>leaflet-draw修改图形坐标点</title>
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
    <link rel="stylesheet" href="./leaflet/leaflet.draw.css" />
    <style>
        html,
        body,
        #map {
            padding: 0;
            margin: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
        }
    </style>
</head>

<body>
    <div id="map"></div>
    <script type="text/javascript" src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
    <script type="text/javascript" src="./leaflet/leaflet.draw.js"></script>
    <script type="text/javascript">

        var map = L.map('map').setView([36.09, 120.35], 13);
        var tiles =
            L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
                attribution: ''
            });
        tiles.addTo(map);

        //添加绘制图层
        var drawnItems = new L.FeatureGroup();
        map.addLayer(drawnItems);
        //添加绘制控件
        var drawControl = new L.Control.Draw({
            draw: {
                //绘制线
                polyline: true,
                //绘制多边形
                polygon: true,
                //绘制矩形
                rectangle: true,
                //绘制圆
                circle: true,
                //绘制标注
                marker: true,
                //绘制圆形标注
                circlemarker: true
            },
            edit: {
                //绘制图层
                featureGroup: drawnItems,
                //图形编辑控件
                edit: true,
                //图形删除控件
                remove: true,
            }
        });

        //添加绘制控件
        map.addControl(drawControl);
        //绘制事件
        map.on(L.Draw.Event.CREATED, function (e) {

            var type = e.layerType,
                //获取绘制图层
                drawlayer = e.layer;
            if (type === 'marker') {
                drawlayer.bindPopup('A popup!');
            }
            drawnItems.addLayer(drawlayer);
        });
    </script>
</body>

</html>